<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>jQuery 文本属性值</title>
</head>
<script src="js/jquery-1.12.4.min.js"></script>
<script>
  $(function(){
   console.log( $('.box1').text());
   console.log($('.box1').html());
   console.log($('.inp').val());
   $('.btn').click(function(){
    var text = $('.inp').val();
    $('.show').append(text);
    var strVar = "";
    strVar += "<img src=\""+ text+"\" alt=\""+text+"\">";
    $('.show').append(strVar);
   
  });

  $('.changeBtn').click(function(){
    $('.change').css(
      {
        "color": 'blue',
        "font-size": "100px",
        'background': "#eee"
      }
    );
     console.log($('.change').css('width'));
  });



  });
</script>
<body>
  <div class="box1">我是测试的文本内容</div>
  <input class="inp" type="text">
  <button class="btn">获取输入的值</button>
  <div class="show"></div>
  <div class="change">我是设置css样式的方法</div>
  <button class="changeBtn">设置样式按钮</button>
</body>

<style>
.show{
  color: blue;
  font-size: 30px;
  font-weight: bold;
}
</style>
</html>